package cn.tedu.flower.manage.Express.impl;

import cn.tedu.flower.manage.Express.dao.ExpressDao;
import cn.tedu.flower.manage.Express.entity.Express;
import cn.tedu.flower.manage.Express.service.ExpressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ExpressServiceImpl implements ExpressService {

    private ExpressDao expressDao;

    @Autowired
    public ExpressServiceImpl(ExpressDao expressDao) {
        this.expressDao = expressDao;
    }

    @Override
    public List<Express> getAllExpress() {
        return expressDao.findAll();
    }

    @Override
    public Express getExpressById(int id) {
        return expressDao.findById(id);
    }

    @Override
    public void addExpress(Express express) {
        expressDao.addExpress(express);
    }

    @Override
    public void updateExpress(Express express) {
        expressDao.updateExpress(express);
    }

    @Override
    public void deleteExpress(int id) {
        expressDao.deleteExpress(id);
    }
}
